package com.wjx.dingcan.service;

import java.util.List;

import org.hibernate.SQLQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.kzw.core.service.hibernate.DefaultEntityManager;
import com.wjx.dingcan.model.Food;

@Service
@Transactional
public class FoodService extends DefaultEntityManager<Food, Long> {
	
	public List<Food>  findByIds(String ids) {
		String sql = "select * from w_Food where oid in(" + ids + ")";
		
		SQLQuery query = entityDao.getSession().createSQLQuery(sql);
		query.addEntity(Food.class);
		List<Food> foods = query.list();
		
		return foods;
	}
}
